wayland: Set title on shell surfaces to window title
authorScott Moreau <oreaus@gmail.com>
Sat, 16 Mar 2013 23:57:17 +0000 (17:57 -0600)
committerRob Bradford <rob@linux.intel.com>
Mon, 18 Mar 2013 12:01:55 +0000 (12:01 +0000)
We currently use this information to display the title
string in the window list of the desktop shell.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
gdk/wayland/gdkwindow-wayland.c

index 6f7e744a7914cc6a55ccaacb2fb7fd468d69aff4..a0ae294fb30a36103560709605ad926f9937e7ad 100644 (file)
@@ -115,6 +115,8 @@ struct _GdkWindowImplWayland
    */
   cairo_surface_t *server_surface;
 
+  gchar *title;
+
   uint32_t resize_edges;
 
   int focus_count;
@@ -282,6 +284,8 @@ _gdk_wayland_display_create_window_impl (GdkDisplay    *display,
 
   g_object_ref (window);
 
+  impl->title = NULL;
+
   switch (GDK_WINDOW_TYPE (window))
     {
     case GDK_WINDOW_TOPLEVEL:
@@ -727,6 +731,9 @@ gdk_wayland_window_show (GdkWindow *window, gboolean already_mapped)
 
   if (impl->cairo_surface)
     gdk_wayland_window_attach_image (window);
+
+  if (impl->shell_surface && impl->title)
+    wl_shell_surface_set_title (impl->shell_surface, impl->title);
 }
 
 static void
@@ -1158,10 +1165,15 @@ static void
 gdk_wayland_window_set_title (GdkWindow   *window,
                              const gchar *title)
 {
+  GdkWindowImplWayland *impl;
   g_return_if_fail (title != NULL);
 
   if (GDK_WINDOW_DESTROYED (window))
     return;
+
+  impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
+  impl->title = strdup (title);
 }
 
 static void